import React, { useState, useEffect } from "react";

// import Draw from "canvas-artboard";

import Draw from '@/plugin/draw'

export default (): JSX.Element => {
  const [drawItem, setDrawItem] = useState<Draw>();

  useEffect(() => {
    setDrawItem(new Draw("canvas", [], '#fff' ,"red", 4));
  }, []);

  return (
    <>
      <div>画板12</div>
      <button onClick={() => drawItem?.setColor("green")}>颜色</button>
      <canvas
        style={{ width: 500, height: 500 }}
        width="500"
        height="500"
        id="canvas"
      ></canvas>
    </>
  );
};
